<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <style>
    #d1{
      width: 200px;
      height: 200px;
      background-color: red;
        /*overflow: hidden: 防止塌陷*/
      overflow: hidden;
    }
    #d2{
        width: 100px;
        height: 100px;
        background-color: blue;
        margin:50px;
    }
    #d3{
        border: 10px solid green;
        border-radius: 10px;
        width: 200px;
        height: 200px;
        margin-left: 200px;
        padding-top: 140px;
        padding-left: 140px;
        /*给元素添加内边距默认情况下会影响元素的显示范围,给元素添加box-sizing:border-box*/
        box-sizing: border-box;
    }
  </style>
</head>
<body>
<div id="d1">
  <div id="d2"></div>
</div>
<div id="d3">哈喽</div>
</body>
</html>